package shiyan1001;

import java.util.Scanner;

class IllegalNameException extends Throwable{
	public IllegalNameException(String s){
		super(s);
	}
}

class IllegalScoreException extends Throwable{
	public IllegalScoreException(String s){
		super(s);
	}
}

class Student{
	private String name;
	private int score;
	public String getName(){
		return name;
	}
	public void setName(String name)throws IllegalNameException{
		if(name.charAt(0)>=48&& name.charAt(0)<=57){
			throw new IllegalNameException("the first char of name must not be digit, name="+name);
		}
		else
			this.name = name;
	}
	public int getScore(){
		return score;
	}
	public int addScore(int score)throws IllegalScoreException{
		if(score>100||score<0)
			throw new IllegalScoreException("score out of range, score="+score);
		else{
			this.score=score;
			return score;
		}
		
	}
	@Override
	public String toString() {
		return "Student [name=" + name + ", score=" + score + "]";
	}
	
}

public class Main {
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		while(sc.next().equals("new")){
			Student stu = new Student();
			try{
				stu.setName(sc.next());
				stu.addScore(sc.nextInt());
				System.out.println(stu);
			}
			catch(IllegalNameException e){
				System.out.println(e);
				
			}
			catch(IllegalScoreException e){
				System.out.println(e);
				
			}
		}
	
	System.out.println("scanner closed");
	}
}
